package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.pojo.vo.SysUserVO;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuJiaWei
 * @version 1.0
 */
@RestController
@RequestMapping("/users")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/add")
    public Result add(@Validated @RequestBody SysUserVO sysUserVO) {
        userService.AddUser(sysUserVO);
        return Result.success();
    }
}
